package huadi.concurrent.waitandnotify;

public class WaitAndNotify {

	public static void main(String[] a) throws InterruptedException {
		final WaitNotify wan = new WaitNotify();

		Thread t1 = new Thread(new Runnable() {
			@Override
			public void run() {
				while (true)
					wan.push(1);
			}
		});

		Thread t2 = new Thread(new Runnable() {
			@Override
			public void run() {
				while (true)
					wan.pop();
			}
		});

		t2.start();
		t1.start();
	}
}

